package com.erhirent.view;

import com.erhairent.tools.InputTools;

public class loginView extends View {

	UserView user = new UserView();
	ManergerView manerger = new ManergerView();

	@Override
	public View showView() {

		System.out.println("输入登录账号:");
		String Name = InputTools.next();

		System.out.println("请输入密码 :");
		String Pwd = InputTools.next();

		// 判断用户是否存在
		if (muser.isSame(Name, Pwd)) {
			if (Name.equals("admin")) {
				// 管理员
				System.out.println("***欢迎管理员来到二嗨租车***");
				manerger.showView();
				manerger.chooseNumber1();

			} else {
				System.out.println("***欢迎" + Name + "来到二嗨租车***");
				// carUsers user = muser.getuser(Name);
				user.showView();
				user.chooseNumber2();
			}

		} else {
			System.out.println("密码错误");
			return showView();
		}

		return mView;
	}

}
